import request from '@/utils/request';

export const getAll = () => request.get('/xinwen/getAll');

export const getXinWenByAuthor = (Author) => request.get('/getXinWenByAuthor',{params:{Author}});

export const getXinWenById = (id) => request.get('/xinwen/getXinWenById',{params:{id}});


/* export const addXin = (data) =>{
  return request.post('/xinwen/addXin',{
    ...data
  });
}
 */

export const addXin = (data) => 
  request.post('/xinwen/addXin',{...data});

export const updateXin = (data) => 
  request.put('/xinwen/updateXin',{...data});

export const deleteXin = (id) => request.delete('/xinwen/deleteXin',{params:{id}});